from application02 import create_app
import os
import application02.utils.http_utils as http_utils

# 创建app
app = create_app(os.getenv('env') or 'default')


@app.errorhandler(404)
def page_not_found(e):
    # 渲染 404 页面
    return http_utils.my_response(404, 'Not Found', status_code=404)


# myapp.py ->
if __name__ == '__main__':
    app.run(host='0.0.0.0', port=8080, debug=True)
    # app.run(host='localhost', port=1024, debug=True)
